package com.explorati.design_pattern.behavior.memento;

public class Article {

	private String title;
	private String content;
	private String imgs;

	public Article(String title, String content, String imgs) {
		this.title = title;
		this.content = content;
		this.imgs = imgs;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getImgs() {
		return imgs;
	}

	public void setImgs(String imgs) {
		this.imgs = imgs;
	}

	public ArticleMemento saveToMemento() {
		ArticleMemento acticleMemento = new ArticleMemento(this.title, this.imgs, this.content);
		return acticleMemento;
	}

	public void undoFromMemento(ArticleMemento articleMemento) {
		this.title = articleMemento.getTitle();
		this.imgs = articleMemento.getImgs();
		this.content = articleMemento.getContent();
	}

	@Override
	public String toString() {
		return "Article{" + "title='" + title + '\'' + ", content='" + content + '\'' + " ,imgs='" + imgs + '\'' + '}';
	}
}
